<!--
 * @Author: wangming
 * @Date: 2020-09-19 11:24:44
 * @LastEditors: wangming
 * @LastEditTime: 2022-05-27 15:50:48
 * @Description: 分页
-->
<template>
  <el-pagination
    v-show="total > 0"
    @size-change="handleSizeChange"
    @current-change="handleCurrentChange"
    :current-page="pageNo"
    :page-sizes="[3, 5, 10, 20, 30, 40, 50, 100]"
    :page-size="pageSize"
    :layout="layout"
    :total="total"
    :small="small"
    :pager-count="pagerCount"
  >
  </el-pagination>
</template>

<script>
export default {
  props: {
    pagerCount: {
      type: Number,
      default: 7,
    },
    layout: {
      type: String,
      default: "total,prev, pager,sizes, next, jumper",
    },
    small: {
      type: Boolean,
      default: false,
    },
    total: {
      type: Number,
      default: 0,
    },
    pageSize: {
      type: Number,
      default: 10,
    },
    pageNo: {
      type: Number,
      default: 1,
    },
  },
  data() {
    return {};
  },
  methods: {
    handleCurrentChange(pageNo) {
      this.$emit("update:pageNo", pageNo);
      this.$emit("search");
    },
    handleSizeChange(pageSize) {
      this.$emit("update:pageSize", pageSize);
      this.$emit("search");
    },
  },
};
</script>

<style lang="scss" scoped></style>
